#!/bin/bash

apt-get update
apt-get install -y vim curl
apt-get install -y git ninja-build iasl bzip2 meson
apt-get install -y g++-mingw-w64 mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev nsis
apt-get install -y python3 python3-venv python3-sphinx
apt-get install -y python3-sphinx-rtd-theme

apt-get install -y pacman-package-manager
echo "# /etc/pacman.conf" > /etc/pacman.conf
echo "[options]" >> /etc/pacman.conf
echo "HoldPkg = pacman" >> /etc/pacman.conf
echo "Architecture = auto" >> /etc/pacman.conf
echo "Color" >> /etc/pacman.conf
echo "CheckSpace" >> /etc/pacman.conf
echo "ParallelDownloads = 5" >> /etc/pacman.conf
echo "SigLevel = Never" >> /etc/pacman.conf
echo "LocalFileSigLevel = Optional" >> /etc/pacman.conf
echo "" >> /etc/pacman.conf
echo "[mingw64]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist.mingw" >> /etc/pacman.conf
echo "" >> /etc/pacman.conf
#echo "[msys]" >> /etc/pacman.conf
#echo "Include = /etc/pacman.d/mirrorlist.msys" >> /etc/pacman.conf

mkdir -p /etc/pacman.d
echo "# /etc/pacman.d/mirrorlist.mingw" > /etc/pacman.d/mirrorlist.mingw
echo "Server = https://mirrors.cloud.tencent.com/msys2/mingw/\$repo/" >> /etc/pacman.d/mirrorlist.mingw
echo "# /etc/pacman.d/mirrorlist.msys" > /etc/pacman.d/mirrorlist.msys
echo "Server = https://mirrors.cloud.tencent.com/msys2/msys/\$arch/" >> /etc/pacman.d/mirrorlist.msys

